Recognising and Generating Terms using Derivatives of Parsing Expression Grammars
نویسندگان
چکیده
Grammar-based sentence generation has been thoroughly explored for Context-Free Grammars (CFGs), but remains unsolved for recognition-based approaches such as Parsing Expression Grammars (PEGs). Lacking tool support, language designers using PEGs have difficulty predicting the behaviour of their parsers. In this paper, we extend the idea of derivatives, originally formulated for regular expressions, to PEGs. We then present a novel technique for sentence generation based on derivatives, applicable to any grammatical formalism for which the derivative can be defined—now including PEGs. Finally, we propose applying derivatives more generally to other problems facing language designers and implementers.
منابع مشابه
Derivatives of Parsing Expression Grammars
This paper introduces a new memoized derivative parsing algorithm for recognition of parsing expression grammars. The algorithm runs in worst case quartic time and cubic space. However, existing research suggests that due to the limited amount of backtracking and recursion in realworld grammars and input, practical performance may be closer to linear time and constant space; experimental valida...
متن کاملGenerating Eecient Substring Parsers for Brc Grammars
The concept of Bounded Context Parseable grammars is a less restricted variation of Bounded Context grammars a class of grammars that is especially suited for substring parsing. Robust parsing is introduced as a special form of parsing for BCP grammars. The di erences between robust parsing and LR(k) parsing are explored. A method of generating robust parsers is presented and complemented by pe...
متن کاملPattern Grammars in Formal Representations of Musical Structures
This paper introduces several formal models of pattern representation in music. Polyvalent multimodal grammars describe partially overlapping sound events as found in polyphonic structures. Bol Processor grammars are characterizations of sequential events in terms of substring repetitions, homomorphisms, etc. Parsing techniques, stochastic production and recent developments of BP grammars are b...
متن کاملLambek Grammars, Tree Adjoining Grammars and Hyperedge Replacement Grammars
Two recent extension of the nonassociative Lambek calculus, the LambekGrishin calculus and the multimodal Lambek calculus, are shown to generate class of languages as tree adjoining grammars, using (tree generating) hyperedge replacement grammars as an intermediate step. As a consequence both extensions are mildly context-sensitive formalisms and benefit from polynomial parsing algorithms.
متن کاملException Handling for Error Reporting in Parsing Expression Grammars
Parsing Expression Grammars (PEGs) are a new formalism to describe a top-down parser of a language. However, error handling techniques that are often applied to top-down parsers are not directly applicable to PEGs. This problem is usually solved in PEGs using a heuristic that helps to simulate the error reporting technique from topdown parsers, but the error messages are generic. We propose the...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1801.10490 شماره
صفحات -
تاریخ انتشار 2018